/*
 * @Autor: dingxiaolin
 * @Date: 2020-05-10 20:53:45
 * @LastEditors: dingxiaolin
 * @LastEditTime: 2020-05-11 17:05:22
 */
'use strict';
/*
if you open the initializer feature, please implement the initializer function, as below:
module.exports.initializer = function(context, callback) {
  console.log('initializing');
  callback(null, ''); 
};
*/
exports.logoff = function (event, context, callback) {
  console.log('event: %s', event);
  var evt = JSON.parse(event);
  var deviceId = evt['headers']['x-ca-deviceid'];
  console.log('deviceId:', deviceId)
  var resp = {
    'statusCode': 200,
    "body": {
      'data': '注销设备成功',
      'deviceId': deviceId
    }
  };

  callback(null, resp);
}